/**
 * 
 */
package com.deloitte.service;

import java.util.TimerTask;

import com.deloitte.service.rest.jersy.SlideInfoService;

/**
 * @author samallick
 *
 */
public class DocumentsLoadScheduler extends TimerTask {
	
	public static boolean loadDocsCache = false;

	/**
	 * 
	 */
	public DocumentsLoadScheduler() {
		super();
	}

	/* (non-Javadoc)
	 * @see java.util.TimerTask#run()
	 */
	@Override
	public void run() {
		if(loadDocsCache){
			loadAllDocsInCache();
		}
		System.out.println("Documents Load Scheduler running");
	}

	private void loadAllDocsInCache(){
		SlideInfoService.loadSlides();
		loadDocsCache = false;
		System.out.println("Documents Load Scheduler executed successfully");
	}
	
	
}
